// undefined 是 void 类型的子类型
// null 是 any 的子类型
// void 是 any 的子类型

// undefined --> void --> any <-- null

type asd = {
  [key: string]: string;
};
let qwe: asd = {
  1: "2",
};

const func = (input: string) => {
  return input.length > 10;
};
type FuncReturnType = ReturnType<typeof func>;
// 2
type Func2 = typeof func;
const func2: typeof func = (name: string) => {
  return name === "nihao";
};

function isString(input: unknown): input is string {
  return typeof input === "string";
}

type Falsy = false | "" | 0 | null | undefined;
const isFalsy = (val: unknown): val is Falsy => !val;

if (isFalsy(123)) {
  console.log("sss");
} else {
  console.log("3ee");
}
